export default {
  /**
   * 
   * @param {*} uplineId 根节点上线
   * @param {*} leaf 当前节点
   * @param {*} isX3 是否x3
   * @param {*} high 树高度
   * @param {*} parent 当前节点的双亲节点
   */
  transfer(uplineId, leaf, isX3 = true, high = 1, parent){
    const node = {
      id: leaf.userId,
      addr: leaf.userAddr,
      uplineId: leaf.referrer,
      status: leaf.referrer == uplineId ? 1 : 2
    }
    if(!isX3) {
      if(high == 1){
        if(uplineId < leaf.referrer) node.status = 3
        if(uplineId > leaf.referrer) node.status = 4
      }else {
        if(parent.referrer < leaf.referrer) node.status = 3
        if(parent.referrer > leaf.referrer) node.status = 4
      }
    }
    return node
  }
}